import { createRouter, createWebHashHistory } from "vue-router";
import Fenlei from '../view/fenlei.vue'
import Index from '../view/index.vue'
import Xiaoxi from "../view/xiaoxi.vue";
import Login from "../view/login.vue";
import My from "../view/my.vue";
const router = createRouter({
    history: createWebHashHistory(),
    routes: [
        {
            path: '/',
            redirect:'/index' ,
            component: Index,
            meta: {
                title: '首页'
            },
        },
        {
            path: '/index', component: Index,
            meta: {
                title: '首页', name: 'home', isTab: true
            },
        },
        {
            path: '/fenlei', 
            component: Fenlei,
            name:Fenlei,
            meta:{title: '分类', isTab: true, isShowNav: true}
        },
       
        {
            path: '/fenlei/:id', 
            component: () => import('../view/goodList.vue'),
            props:true,
            name:'listDetail',
            meta: { title: '商品列表', isTab: true, isShowNav: true, isShowBack: true }
        },
      
        {
            path:'/fenleiDetail/:detailiId',
            component:() => import('../view/shangpin.vue'),
            props:true,
            name:'goods',
            meta: { title: '商品详情', isTab: false, isShowNav: true, isShowBack: true }
        },

        {
            path: '/xiaoxi', component: Xiaoxi,
            meta: { title: '消息', isTab: true, isShowNav: true }
        },
        {
            path: '/gouwuche', 
            component: () => import('../view/gouwuche.vue'),
            props:true,
            meta: { title: '购物车', isTab: true, isShowNav: true, isShowBack: true }
        },
        {
            path: '/my', 
            component: My,
            meta: { title: '我的', isTab: true }
        },
        { path: '/login', 
            name: 'Login', 
            component: Login,
            meta: { 
                title: '登录', 
                isTab: true, 
                isShowNav: true, 
                isShowBack: true 
            }},

        { path:'/register',
          component:() => import('../view/register.vue'),
          meta: { title: '注册', isTab: true, isShowNav: true, isShowBack: true }
        }
    ]
})



export default router;